package com.gateway.video.rtsp.server.transport.rtcp.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.socket.DatagramPacket;
import lombok.var;

public class RtcpServerHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        super.channelActive(ctx);
        ctx.read();
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        var packet = (DatagramPacket)msg;
        var readableBytes = packet.content().readableBytes();

        /* 将连接信息与开始读取的信息传递给服务端 */
        ctx.read();
    }
}
